home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15289 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  801 b 

  1. Path: li.net!jeremy
  2. From: jeremy@newshost.li.net (Jeremy Markman)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: another overloading question
  5. Date: 4 Apr 1996 17:44:59 GMT
  6. Organization: LI Net (Long Island Network)
  7. Distribution: world
  8. Message-ID: <4k11qr$m5d@linet06.li.net>
  9. References: <4ju98d$3al@panoramix.fi.upm.es>
  10. NNTP-Posting-Host: linet04.li.net
  11. X-Newsreader: TIN [version 1.2 PL2]
  12.  
  13. Sacha (sacha@diafi.upm.es) wrote:
  14.  
  15. : Hi,
  16.  
  17. : Can I overload = for simple types?
  18.  
  19. WHen you overload operators, the return type must be that class.
  20.  
  21. THat is, when you add two integers, every operand is an integer.  So, 
  22. consequently, if you were to add or assign a class operator, each operand 
  23. must be that class.
  24.  
  25. So, it won't work in your case where you try and set a different type = 
  26. to a class type...
  27.  
  28. Make sense?
  29.